<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul id="list">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>

    <script>
        let list = document.querySelectorAll("#list li");
        list = Array.from(list);
        // list = [...list];
        console.log(list);
    </script>

    <script>
        let list2 = document.querySelectorAll("#list li");
        let arr = [];
        list2 = Array.from(list2, (item, index) => {
            console.log(item, index, this);
            return index;
        }, arr);
        console.log(list2);
    </script>
</body>
</html>